package me.firstapp.spi.bbs;

import java.util.Map;

import me.firstapp.common.json.PageObject;
import me.firstapp.common.json.SingleObject;
import me.firstapp.common.module.bbs.JsonMember;

public interface MemberService {

	/**
	 * 调用用户注册接口
	 * 
	 * @param email
	 * @param name
	 * @param password
	 * @param code
	 * @return
	 */
	SingleObject<JsonMember> register(String email, String name, String password, String code);

	/**
	 * 调用用户登录接口
	 * 
	 * @param account
	 * @param password
	 * @return
	 */
	SingleObject<JsonMember> login(String account, String password);

	/**
	 * 调用通过id获取用户接口
	 * 
	 * @param id
	 * @return
	 */
	SingleObject<JsonMember> findMemberById(Long id);

	/**
	 * 调用更新用户信息接口
	 * 
	 * @param memberId
	 * @param avatar
	 * @param url
	 * @param signature
	 * @param status
	 * @return
	 */
	SingleObject<JsonMember> updateMemberInfo(Long memberId, String avatar, String url, String signature,
			Integer status);

	/**
	 * 调用修改登录密码接口
	 * 
	 * @param memberId
	 * @param oldPassword
	 * @param newPassword
	 * @param code
	 * @return
	 */
	SingleObject<Object> alterLoginPassword(Long memberId, String oldPassword, String newPassword, String code);

	/**
	 * 调用分页查询用户接口
	 * 
	 * @param pageNo
	 * @param pageSize
	 * @param searchParams
	 * @param sortParam
	 * @param sortType
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	PageObject<JsonMember> findMemberPage(Integer pageNo, Integer pageSize, Map<String, Object> searchParams,
			String sortParam, String sortType, Long startTime, Long endTime);

	/**
	 * 调用重置密码接口
	 * 
	 * @param email
	 * @param code
	 * @param newPassword
	 * @return
	 */
	SingleObject<Object> resetPassword(String email, String code, String newPassword);
}
